var App = {}, Act = {};
App.init = function(){
  Ext.namespace('Act');
  Ext.Loader.setPath('Ext.ux', 'asset/ext/ux');
  Ext.QuickTips.init();
  delete Ext.tip.Tip.prototype.minWidth;

  Ext.application({
    name: 'Act',
    appFolder: 'asset/app',
    launch: function(){
      var me = this;
      Act.system = Ext.create('Act.system.System');
      Act.system.setViewport(Ext.create('Act.view.region.Viewport'));
    }
  })
}

App.addNewTab = function(id, url){
  var view = Act.system.getViewport().down('mainregion');
  var tab = view.down('panel#' + id);
  if(!tab){
    tab = Ext.create("Ext.panel.Panel", {
      id: id,
      title: "页面管理",
      pageName: "页面管理",
      layout: "border",
      closable: true,
      loader: {
        autoLoad: !0,
        url: url,
        loadMask: !0,
        scripts: !0,
        scope: this,
      }
    })
    tab = view.add(tab);
  }
  view.setActiveTab(tab);
}